N=int(input())
if N<=5:
    print(N+2)
elif N==6:
    print('1')
else:
    print('2')
